function valiMes(content,vnum,firstnum,secondnum){
  let errors = "";
  if(!content || content.length > 100){
    errors = errors || {};
    errors.content = "留言信息不得为空，且应在100字以内。";
  }
  if(!(Number(vnum) === firstnum + secondnum)){
    errors = errors || {};
    errors.vnum = "验证码输入有误，请重新输入。";
  }
  console.log(errors);
  return errors;
}

function showInfo(errors){
  if(errors){
    // console.log(errors);
    // console.log(typeof errors);
    errors = JSON.parse(errors);
    if(errors.content){
      contenterror.innerText = errors.content;
    }
    if(errors.vnum){
      vnumerror.innerText = errors.vnum;
    }
  }
}

if(typeof window === "undefined"){
  module.exports = valiMes;
}
